import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
// import * as actions from '../actions/index';
import ErrorPage from 'components/errorPage';
import { enterPage } from 'utils/track';

class Root extends Component {
  componentDidMount() {
    enterPage('Error');
  }

  render() {
    const { pageInfo } = this.props;
    const { errorCode, errorMessage, errorAction, errorTraceId } = pageInfo;

    return (
      <ErrorPage
        errorCode={errorCode}
        errorMessage={errorMessage}
        errorAction={errorAction}
        errorTraceId={errorTraceId}
      />
    );
  }
}

export default connect(
  (state) => state.root,
  (dispatch) => bindActionCreators({}, dispatch),
)(Root);
